package org.zxp.designpattern.factory.simplefactory;

/**
 * @program: effectiveJava
 * @description:
 * @author: X-Pacific zhang
 * @create: 2019-08-20 16:45
 **/
public class PeopleFactory {
    public static People getInstance(PeopleType peopleType) throws Exception {
        switch (peopleType){
            case MAN:
                return new Man();
            case WOMEN:
                return new Women();
        }
        throw new Exception("未找到类型");
    }

}
